home *** CD-ROM | disk | FTP | other *** search
- We provide the source code (3 .c files and 3 .h files) for a demo program.
-
- You need to edit the source code before you compile. In the main.c, find this
- line:
- SPH_begin (500,400, numplanes, numshades);
-
- Change the first two numbers so they represent the size of (number of pixels
- across and down) your screen.
-
- Also look for this line in main.c:
- READ_FROM_STDIN = TRUE;
-
- You may need to change TRUE to FALSE to get things to work on your system.
-
-
-
- This program is an interactive model-viewing system. A model of a neighborhood
- of houses is created and the camera is initialized. You can change the
- camera's position, orientation, and parameters by using keystrokes. The user
- interface is poor, but it is a satisfactory method for getting acquainted with
- the SPHIGS camera model.
-
- Two images of the model are visible on the screen. In the larger viewport is a
- solid, shaded image that is the (currently) highest-quality image SPHIGS can
- produce. In the smaller viewports are wireframe-raw images produced using
- ORTHOGRAPHIC projection; they also show the view volume and the location of the
- PRP and VRP.
-
- To QUIT (exit) the program type Q or q
-
- The numeric keys allow you to choose which part of the camera you wish to
- modify. Each time you hit one of these keys, a prompt is sent to the screen to
- remind you which camera part you are currently manipulating.
-
- 1 change the VRP along the UVN axes
- (to move the camera relative to current orientation)
- 2 change the VRP along the XYZ axes
- (to move the camera relative to World Coordinate system)
- 3 change the VPN (to rotate the camera)
- 4 change the PRP (to change the focal length)
- 5 change the front clipping-plane distance
- 6 change the back clipping-plane distance
-
- 0 restore the camera to default location, orientation, etc.
-
- You manipulate the "camera part" that you have selected, on three axes:
- X (or U)
- Y (or V)
- Z (or N)
-
- To manipulate on the X axis, you use "s" for left and "d" for right.
- "s" subtracts "d" adds
-
- To manipulate on the Y axis, you use "e" for up and "x" for down.
- "x" subtracts "e" adds
-
- To manipulate on the Z axis, you use "=" to move away from the model (towards
- positive infinity) and "-" to move into the model. (The model's vertices all
- have negative Z coords.)
- "-" subtracts "=" adds
-
- Each time you hit one of the above six keys, the camera is moved by STEPSIZE
- units or rotated by STEPSIZE degrees. The default step size is 30
- units/degrees, but you can manipulate the step size using the "<" (to decrease
- it by 5) and ">" (to increase it by 5) keys. The current step size is
- echoed to the console whenever it is changed.
-
- You can restore the camera's attributes to their default values (as they are
- when the program starts up) by hitting '0'. This is a great way to recover if
- you've gotten "lost".
-
- You can add a chimney to each house by entering a capital "C", and remove it by
- entering a lowercase "c".
-
- You can eliminate the wireframe orthographic views (and blow up the nicely
- renderered view to full window size) by hitting lowercase 'a', and restore all
- the views by hitting capital 'A'.
-
- You can toggle the larger view between its default lit-flat rendering and
- the alternative "high-quality wireframe" by hitting:
- "n" to set rendering to lit-flat
- "m" to set rendering to wireframe
-
- Input pick correlation is demonstrated by simply clicking the mouse button
- anywhere within the main (perspective) viewport. If you click on any part of a
- house, you will see a message reporting which house you picked.
-